package com.tepth.busfix.main.login;

import com.tepth.busfix.bean.reponse.User;
import com.tepth.busfix.network.ApiModel;
import com.tepth.busfix.network.observer.SimpleDisposableObserver;

/**
 * Created by TMVPHelper on 2017/03/13
 */
class LoginPresenter extends LoginContract.Presenter {

    @Override
    void login() {
        mRxManager.add(mModel.login(mView.getAccount(), mView.getPassword())
                .subscribeWith(new SimpleDisposableObserver<ApiModel<User>>(mView) {

                    @Override
                    public void onSucceed(Object o) {
                        User user = (User) o;
                        mView.showUser(user);
                    }
                }));
    }
}